package com.hello.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.sky.annotation.AutoFill;
import com.hello.sky.enmu.OperationType;
import com.hello.sky.model.entity.Category;
import com.hello.sky.result.Result;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 菜品及套餐分类 Mapper 接口
 * </p>
 *
 * @author D
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    List<Category> getListByType(@Param("type") Integer type);

    @AutoFill(OperationType.INSERT)
    void addCategory(@Param("category") Category category);

    @AutoFill(OperationType.UPDATE)
    void updateStatus(@Param("status") Integer status, @Param("id") Integer id);

    void delCategoryById(@Param("id") Integer id);

    @AutoFill(OperationType.UPDATE)
    void updateCategory(Category category);
}
